Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Abracadabra and Improvised Skill #2859

Closed
wants to merge 1 commit into from

Conversation

dastgirp
Copy link
Member

@dastgirp dastgirp commented Oct 2, 2020

Pull Request Prelude

The Autocast by abra was cleared before the actual casting, which resulted in failure of skill if not learned.

Changes Proposed

Adding ret = 0 check while casting skill, to clear the autocast data

Issues addressed:

The Autocast by abra was cleared before the actual casting, which resulted in failure of skill if not learned.

Fixes HerculesWS#2823
Fixes HerculesWS#2824
@dastgirp dastgirp requested review from Kenpachi2k13 and 4144 October 2, 2020 11:10
@dastgirp dastgirp added component:mechanics:skills Affecting the skills' game mechanics severity:2-fair Incorrect gaming mechanics, database warnings type:bug Issue is a bug or describes an incorrect behavior that should be fixed labels Oct 2, 2020
@@ -1155,7 +1155,7 @@ static int unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_
int ret = unit->skilluse_id2(src, target_id, skill_id, skill_lv, casttime, castcancel);
struct map_session_data *sd = BL_CAST(BL_PC, src);

if (sd != NULL)
if (sd != NULL && ret == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this mean after this change auto cast never cleaned if skill was used without errors?
i think this wrong

Copy link
Member

@Kenpachi2k13 Kenpachi2k13 Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit->skilluse_id2() returns 0 on failure, so this is okay. (Nevermind... I misread your comment.)

Maybe the

else if (sd != NULL && ret != 0 && skill_id != SA_ABRACADABRA && skill_id != WM_RANDOMIZESPELL)
		skill->validate_autocast_data(sd, skill_id, skill_lv);

block I removed in #2699 (LINK) should be re-added, too.
I currently can't have a closer look at this, so this is just a suggestion...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@4144 the problem is, this function is triggered before actual casting of skill, so removing this check caused autocast struct to be emptied, and skill failed to cast.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dastgirp This definitely needs to be adressed what 4144 mentioned.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a look at this and the condition should be changed to:

if (sd != NULL && (ret == 0 || (skill_id != SA_ABRACADABRA && skill_id != WM_RANDOMIZESPELL)))

@AnnieRuru AnnieRuru added this to the Release v2020.10.19 milestone Oct 5, 2020
@MishimaHaruna MishimaHaruna added the hacktoberfest-accepted Easy-to-tackle issues label Oct 20, 2020
@MishimaHaruna MishimaHaruna marked this pull request as draft January 11, 2021 18:53
MishimaHaruna added a commit to MishimaHaruna/Hercules that referenced this pull request Apr 6, 2021
This commit introduces various fixes to the Abracadabra / Improvise
skill validation:

- autocast code is moved to after homun/merc skill ranges so that when
  any of those are triggered, autocast data is not purged
- abracadabra/improvise is no longer purged immediately after cast, by
  calling autocast_clear_current in the proper manner
- the abracadabra/improvise skill requirement bypass that was removed in
  HerculesWS#2657 and related pull requests is re-implemented
- the condition that would get the character stuck and unable to cast
  other skills until teleporting or relogging when rolling AL_WARP from
  abracadabra (i.e. because AL_WARP lands in clif_parse_UseSkillMap in 2
  steps) is fixed, by not immediately clearing the data after the first
  one

All credits for the fix go to Heka of Origins

Related to HerculesWS#2859
Fixes HerculesWS#2823
Fixes HerculesWS#2824

Signed-off-by: Haru <[email protected]>
@MishimaHaruna
Copy link
Member

I'm closing this in favor of the more complete fix (extensively tested on a production server) from #2972

MishimaHaruna added a commit to MishimaHaruna/Hercules that referenced this pull request Apr 6, 2021
This commit introduces various fixes to the Abracadabra / Improvise
skill validation:

- abracadabra/improvise is no longer purged immediately after cast, by
  calling autocast_clear_current in the proper manner
- the abracadabra/improvise skill requirement bypass that was removed in
  HerculesWS#2657 and related pull requests is re-implemented
- the condition that would get the character stuck and unable to cast
  other skills until teleporting or relogging when rolling AL_WARP from
  abracadabra (i.e. because AL_WARP lands in clif_parse_UseSkillMap in 2
  steps) is fixed, by not immediately clearing the data after the first
  one

All credits for the fix go to Heka of Origins

Related to HerculesWS#2859
Fixes HerculesWS#2823
Fixes HerculesWS#2824

Signed-off-by: Haru <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:mechanics:skills Affecting the skills' game mechanics hacktoberfest-accepted Easy-to-tackle issues severity:2-fair Incorrect gaming mechanics, database warnings type:bug Issue is a bug or describes an incorrect behavior that should be fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants